package com.vision.sales.cl.resource;

import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ImageResource;
import com.sencha.gxt.data.shared.IconProvider;
import com.vision.core.cm.data.TaskNode;
import com.vision.sales.cl.SalesTasks;

/**
 * 
 * @author Mark
 *
 */
public class MenuIconProvider implements IconProvider<TaskNode> {

	private static final SalesResources bundle = GWT.create(SalesResources.class);
	
	@Override
	public ImageResource getIcon(TaskNode model) {
		
		// MASTERLIST
		if (SalesTasks.MASTERLIST.getId().equals(model.getId()))
			return bundle.masterlist();
		
		if (SalesTasks.PRODUCTS.getId().equals(model.getId()))
			return bundle.products();
		
		if (SalesTasks.CUSTOMERS.getId().equals(model.getId()))
			return bundle.customers();
		
		if (SalesTasks.SALESMEN.getId().equals(model.getId()))
			return bundle.salesmen();
		
		if (SalesTasks.CHECKS.getId().equals(model.getId()))
			return bundle.checks();
		
		if (SalesTasks.MONTHLY_TOTALS.getId().equals(model.getId()))
			return bundle.monthlyTotals();
		
		
		// TRANSACTIONS
		
		if (SalesTasks.TRANSACTIONS.getId().equals(model.getId()))
			return bundle.transactions();
		
		if (SalesTasks.DELIVERY_RECEIPTS.getId().equals(model.getId()))
			return bundle.deliveryReceipts();
		
		if (SalesTasks.SALES_INVOICES.getId().equals(model.getId()))
			return bundle.salesInvoices();
		
		if (SalesTasks.COLLECTIONS.getId().equals(model.getId()))
			return bundle.collections();
		
		if (SalesTasks.CREDIT_MEMOS.getId().equals(model.getId()))
			return bundle.creditMemos();
		
		if (SalesTasks.DEBIT_MEMOS.getId().equals(model.getId()))
			return bundle.debitMemos();
		
		if (SalesTasks.ADVANCE_PAYMENTS.getId().equals(model.getId()))
			return bundle.advancePayments();
		
		// REPORTS
		
		if (SalesTasks.REPORTS.getId().equals(model.getId()))
			return bundle.reports();
		
		if (SalesTasks.CUSTOMER_LEDGER.getId().equals(model.getId()))
			return bundle.customerLedger();
		
//		if (SalesTasks.SUMMARY_CUSTOMER.getId().equals(model.getId()))
//			return bundle.summaryCustomer();
		
		if (SalesTasks.CUSTOMER_SALES.getId().equals(model.getId()))
			return bundle.customerSales();
		
//		if (SalesTasks.MONTHLY_CUSTOMER_SALES.getId().equals(model.getId()))
//			return bundle.monthlyCustomerSales();
//		
//		if (SalesTasks.ANNUAL_CUSTOMER_SALES.getId().equals(model.getId()))
//			return bundle.annualCustomerSales();
		
		if (SalesTasks.PRODUCT_SALES.getId().equals(model.getId()))
			return bundle.productSales();
		
		if (SalesTasks.MONTHLY_GROUP_SALES.getId().equals(model.getId()))
			return bundle.monthlyGroupSales();
		
		if (SalesTasks.SALESMAN_SALES.getId().equals(model.getId()))
			return bundle.salesmanSales();
		
		if (SalesTasks.INDIV_SALESMAN_SALES.getId().equals(model.getId()))
			return bundle.indivSalesmanSales();
		
		if (SalesTasks.INDIV_SALESMAN_COMM.getId().equals(model.getId()))
			return bundle.indivSalesmanComm();
		//
		if (SalesTasks.OUTSTANDING_RECEIVABLES.getId().equals(model.getId()))
			return bundle.outstandingReceivables();
		
		if (SalesTasks.DELIVERY_RECEIPTS_REPORT.getId().equals(model.getId()))
			return bundle.deliveryReceiptsReport();
		
		if (SalesTasks.INDIVIDUAL_SOA.getId().equals(model.getId()))
			return bundle.individualSoa();
		
		if (SalesTasks.CUSTOMER_AGING_ANALYSIS.getId().equals(model.getId()))
			return bundle.customerAging();
		
		if (SalesTasks.COMMISSION_REPORT.getId().equals(model.getId()))
			return bundle.commissionReport();
		
		return null;
	}

}
